<?php
//debug($projectTypes);
?>
<div class="row">
    <div class="span1 text-right">
        <h1>
            <?php echo $this->Html->link('<i class="icon-arrow-left-3"></i>', '/Projects/listAll/' . $propertyId, array('escape' => false, 'title' => 'Back')) ?>
        </h1>
    </div>

    <div class="span10">

        <div class="span12 no-margin text-left">
            <h3 class="widget-title">Add <?php echo $propertyName?> Project</h3>
            <?php if ($this->Session->check('add_project')) { ?>
                <ul>
                    <li><i class="icon-play"></i> ขั้นตอนที่ 1 เพิ่มรายละเอียดโปรเจค</li>
                    <li class="c-gray"><i class="icon-cancel-2"></i> ขั้นตอนที่ 2 เพิ่มและแก้ไขภาษา อื่น ๆ</li>
                    <li class="c-gray"><i class="icon-cancel-2"></i> ขั้นตอนที่ 3 เพิ่มรูปภาพ </li>
                </ul>
            <?php } ?>
        </div>


        <?php
        echo $this->Form->create('Project', array(
            'novalidate' => true,
            'format' => array('before', 'label', 'error', 'between', 'input', 'after')
        ));
        ?>
        <div class="span12 margin-top">  
            <table width="100%">
                <tr valign="top">
                    <td width="20%" align="right">Project Type *</td>
                    <td>
                        <div data-role="input-control" class="input-control select">
                            <?php
                            echo $this->Form->input('Project.project_type_id', array(
                                'options' => $projectTypes,
                                'empty' => '(choose one)',
                                'label' => false,
                                'disabled' => true,
                                'selected' => $projectTypeId
                            ));
                            ?>
                        </div>

                    </td>
                </tr>
                <tr valign="top">
                    <td width="20%" align="right">Property Type *</td>
                    <td>
                        <div data-role="input-control" class="input-control select">
                            <?php
                            echo $this->Form->input('Project.property_type_id', array(
                                'options' => $properties,
                                'empty' => '(choose one)',
                                'label' => false
                            ));
                            ?>
                        </div>

                    </td>
                </tr>
                <tr valign="top">
                    <td align="right">Location *</td>
                    <td>
                        <div data-role="input-control" class="input-control select">
                            <?php
                            echo $this->Form->input('Project.amphur_id', array(
                                'options' => $province,
                                'default' => 'Chiang Mai',
                                'label' => false
                            ));
                            ?>
                        </div>

                    </td>
                </tr>
                <tr valign="top">
                    <td align="right">Title *</td>
                    <td>
                        <div class="input-control text" data-role="input-control">
                            <?php echo $this->Form->input('ProjectDetail.title', array('label' => false)); ?>
                        </div>
                    </td>
                </tr>
                <tr valign="top">
                    <td align="right">Code *</td>
                    <td>
                        <div class="input-control text" data-role="input-control">
                            <?php echo $this->Form->input('Project.code', array('label' => false)); ?>
                        </div>
                    </td>
                </tr>
                <tr valign="top">
                    <td align="right">Company</td>
                    <td>
                        <div class="input-control text" data-role="input-control">
                            <?php echo $this->Form->input('ProjectDetail.company', array('label' => false)); ?>
                        </div>
                    </td>
                </tr>
                <tr valign="top">
                    <td align="right">Price Start *</td>
                    <td>
                        <div class="input-control text" data-role="input-control">
                            <?php echo $this->Form->input('ProjectDetail.price', array('label' => false)); ?>
                        </div>
                    </td>
                </tr>
                <tr valign="top">
                    <td align="right">Bedroom</td>
                    <td>
                        <div class="input-control text" data-role="input-control">
                            <?php echo $this->Form->input('ProjectDetail.bedroom', array('label' => false)); ?>
                        </div>
                    </td>
                </tr>
                <tr valign="top">
                    <td align="right">Promotion</td>
                    <td>
                        <div data-role="input-control" class="input-control textarea">
                            <?php
                            echo $this->Form->input('ProjectDetail.promotion', array(
                                'type' => 'textarea',
                                'placeholder' => false,
                                'label' => false
                            ));
                            ?>
                        </div>
                    </td>
                </tr>
                <tr valign="top">
                    <td align="right">Descriptions</td>
                    <td>
                        <div data-role="input-control" class="input-control textarea">
                            <?php
                            echo $this->Form->input('ProjectDetail.descriptions', array(
                                'type' => 'textarea',
                                'placeholder' => false,
                                'label' => false
                            ));
                            ?>
                        </div>
                    </td>
                </tr>
                <tr valign="top">
                    <td align="right">Address</td>
                    <td>
                        <div data-role="input-control" class="input-control textarea">
                            <?php
                            echo $this->Form->input('ProjectDetail.address', array(
                                'type' => 'textarea',
                                'placeholder' => '',
                                'label' => false
                            ));
                            ?>
                        </div>
                    </td>
                </tr>
                <tr valign="top">
                    <td></td>
                    <td>
                        <?php echo $this->Form->submit('SAVE & NEXT', array('class' => 'button success')); ?>
                    </td>
                </tr>
            </table>
        </div>        
        <?php echo $this->Form->end(); ?>
    </div>
</div>